package cn.rxmind.dlicense.core.exception;

import lombok.Getter;
import lombok.Setter;

/**
 *
 * @description 基础异常定义
 *
 * @author renxin
 *
 * @email renxinzhiliangzhi@163.com
 * 
 * @date 2019/7/25 14:34
 */
@Setter
@Getter
public class DLicenseException extends RuntimeException{

    private Integer code;

    private String message;

    public DLicenseException(DLicenseErrEnum dLicenseErrEnum) {

        super(dLicenseErrEnum.getMessage());
        this.code = dLicenseErrEnum.getCode();
        this.message = dLicenseErrEnum.getMessage();
    }

    public DLicenseException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public DLicenseException(String message) {
        super(message);
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}
